gtk_theming_background_snapshot_color (GtkCssBoxes *boxes,
GtkSnapshot *snapshot,
const GdkRGBA *bg_color,
- const GtkCssValue *background_image)
+ guint n_bg_values)
{
const GskRoundedRect *box;
- gint n_values;
GtkCssArea clip;
-
- n_values = _gtk_css_array_value_get_n_values (background_image);
- clip = _gtk_css_area_value_get (_gtk_css_array_value_get_nth (boxes->style->background->background_clip, n_values - 1));
+
+ clip = _gtk_css_area_value_get (_gtk_css_array_value_get_nth (boxes->style->background->background_clip, n_bg_values - 1));
box = gtk_css_boxes_get_box (boxes, clip);
if (gsk_rounded_rect_is_rectilinear (box))
gboolean has_bg_color;
gboolean has_bg_image;
gboolean has_shadow;
- gint idx;
+ int idx;
+ guint number_of_layers;
if (background->base.type == GTK_CSS_BACKGROUND_INITIAL_VALUES)
return;
snapshot,
gtk_css_boxes_get_border_box (boxes));
+ number_of_layers = _gtk_css_array_value_get_n_values (background_image);
+
if (has_bg_image)
{
GtkCssValue *blend_modes = background->background_blend_mode;
- const int number_of_layers = _gtk_css_array_value_get_n_values (background_image);
GskBlendMode *blend_mode_values = g_alloca (sizeof (GskBlendMode) * number_of_layers);
for (idx = number_of_layers - 1; idx >= 0; idx--)
}
if (has_bg_color)
- gtk_theming_background_snapshot_color (boxes, snapshot, bg_color, background_image);
+ gtk_theming_background_snapshot_color (boxes, snapshot, bg_color, number_of_layers);
for (idx = number_of_layers - 1; idx >= 0; idx--)
{
}
else if (has_bg_color)
{
- gtk_theming_background_snapshot_color (boxes, snapshot, bg_color, background_image);
+ gtk_theming_background_snapshot_color (boxes, snapshot, bg_color, number_of_layers);
}
if (has_shadow)